<!-- **************************************************************-->
<!-- *                                                            *-->
<!-- *    .=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.      *-->
<!-- *    |                     ______                     |      *-->
<!-- *    |                  .-"      "-.                  |      *-->
<!-- *    |                 /            \                 |      *-->
<!-- *    |     _          |              |          _     |      *-->
<!-- *    |    ( \         |,  .-.  .-.  ,|         / )    |      *-->
<!-- *    |     > "=._     | )(__/  \__)( |     _.=" <     |      *-->
<!-- *    |    (_/"=._"=._ |/     /\     \| _.="_.="\_)    |      *-->
<!-- *    |           "=._"(_     ^^     _)"_.="           |      *-->
<!-- *    |               "=\__|IIIIII|__/="               |      *-->
<!-- *    |              _.="| \IIIIII/ |"=._              |      *-->
<!-- *    |    _     _.="_.="\          /"=._"=._     _    |      *-->
<!-- *    |   ( \_.="_.="                    "=._"=._/ )   |      *-->
<!-- *    |    > _.="                            "=._ <    |      *-->
<!-- *    |   (_/                                    \_)   |      *-->
<!-- *    |                                                |      *-->
<!-- *    '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='      *-->
<!-- *                                                            *-->
<!-- *           LASCIATE OGNI SPERANZA, VOI CH'ENTRATE           *-->
<!-- **************************************************************-->
<!-- 小正科技版权所有  作者小正QQ:1419158026  Full stack programmer!-->
<!-- 最后装订时间:                      维护人员:小正               -->
<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <!-- 引入JS框架 -->
    <script src="/static/js/jquery-3.4.1.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="/static/js/layui/css/layui.css">
    <!-- 引入组件库 -->
    <script src="/static/js/layui/layui.all.js"></script>
    <!-- 引入核心JS-->
    <script src="/static/js/main.js" type="module"></script>
    <script src="/static/js/base64.js" type="module"></script>
    <script src="//unpkg.com/wangeditor/release/wangEditor.min.js"></script>
    <title>发布</title>
    <script>

    </script>
</head>
<div id="editor"></div>
<input id="inp_tit" type="text" placeholder="请输入标题" autocomplete="off" class="layui-input">
<input id="inp_class" type="text" placeholder="请输入类型" autocomplete="off" class="layui-input">
<button type="button" class="layui-btn" onclick="add()">发布</button>
<script type="text/javascript">
    var E = window.wangEditor;
    var editor = new E('#editor');
    editor.customConfig.uploadImgShowBase64 = true;
    editor.create();

    function add() {
        var data_text = $.base64.encode(editor.txt.html());
        console.log(data_text);
        var data_title = $('#inp_tit').val();
        var data_class = $('#inp_class').val();
        var data = "data_text=" + data_text + "&data_title=" + data_title + "&data_class=" + data_class;
        $.post("/api/doc/add", data, function (data_ret) {
            console.log(data_ret);
        });
    }
</script>
</body>
</html>
